package com.wangkang.educms.controller;
import com.wangkang.commonutils.R;
import com.wangkang.educms.entity.CrmBanner;
import com.wangkang.educms.service.CrmBannerService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@RestController
@Api(tags = "Banner前端管理")
@RequestMapping("/educms/bannerFront")
//@CrossOrigin
public class BannerFrontController {
    @Autowired
    private  CrmBannerService crmBannerService;

    public BannerFrontController(CrmBannerService crmBannerService) {
        this.crmBannerService = crmBannerService;
    }

    @ApiOperation("查询所有的Banner")
    @GetMapping("/getAllBanner")
    public R getAllBanner(){
        //List<CrmBanner> bannerList = crmBannerService.selectAllBanner();
        List<CrmBanner> bannerList = crmBannerService.selectIndexList();
        return R.ok().data("list",bannerList);
    }
}